package com.guoxin.chapter7;

/**
 * 父类中定义的静态语句块要优先于子类的变量赋值操作
 *
 * @author guoxin
 * @date 2019/9/24
 */
public class SuperStaticPrioritySubStatic {
    public static void main(String[] args) {
        System.out.println(Sub.B);
    }

    static class Parent {
        public static int A = 1;

        static {
            A = 2;
        }
    }

    static class Sub extends Parent {
        public static int B = A;
    }
}
